<!DOCTYPE html>
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- 引入 ECharts 文件 -->
        <script src="js/echarts.min.js"></script>
        <script src="js/jquery-1.10.2.js"></script>
    </head>
    <body>
        <div id="main" style="width: 600px;height:400px;"></div>
        <script type="text/javascript">
            var myChart = echarts.init(document.getElementById('main'));
            function getData(){
                $.ajax({
                     type:'GET',
                     url:'http://localhost:8080/echartJ/webresources/service.jsontest/count',
                     dataType: "json",
                     error:function(XMLHttpRequest, textStatus, errorThrown){
                         alert(textStatus);
                     },
                     success: function(data){
                         if(window.console){
                             console.log(data);
                         }
                         myChart.setOption(data);
                     }

                });
            }
        </script>
        <button onclick="getData();">绘制图表 go</button>

    </body>
</html>
